require("common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/personnel/personnel_apply" ], {
    3270: function(t, e, i) {
        "use strict";
        (function(t) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var a = i("b00d"), n = {
                data: function() {
                    return {
                        idCard1: "./static/ps2cd8e5feb924c1f4-b826-4dcd-a986-c338a92b57db.png",
                        idCard2: "./static/ps8f524a9bcb0ab440-6a40-408d-86a1-64d365a2168a.png",
                        graceFullLoading: !0,
                        applyName: "",
                        applyTel: "",
                        applyTel2: "",
                        applyCategory: [],
                        applyCategorys: [],
                        applyCategorysChild: {},
                        catetype: 0,
                        cateIndex: -1,
                        applStatus: 0,
                        userWxInfo: {},
                        categorysVal: [],
                        msg: "",
                        showMsg: !1,
                        tmplIds: [],
                        uploadServerUrl: "",
                        content: "",
                        card1: "",
                        card2: "",
                        alipay: "",
                        ischeck: !0,
                        cardid: "",
                        show1: !1,
                        iscard: 0,
                        deposit: 0,
                        depositpay: 0,
                        isdeposit: 1,
                        isalipay: 0,
                        formdata: "",
                        selectedimgs: [],
                        imgs: "",
                        isWxPay: !1,
                        showLogin: !1,
                        paytype: "押金",
                        photoRemark: "",
                        showBack: !1,
                        appid: "",
                        ispic: 0,
                        jionName: "",
                        showname: "",
                        showcate: "",
                        showother: 2,
                        distributorid: 0
                    };
                },
                onLoad: function(t) {
                    if (t.scene) {
                        var e = decodeURIComponent(t.scene).split("&")[0].split("=");
                        "distributor" == e[0] && e[1] > 0 && (this.distributorid = e[1]);
                    }
                    t.distributor > 0 && (this.distributorid = t.distributor);
                    var i = a.d;
                    "wx5a67ffb91ef175cb" == i || "wxcaad2fca5f5aeba1" == i ? (this.showname = "昵称", 
                    this.showcate = "可提供的服务") : (this.showname = "真实姓名", this.showcate = "服务行业"), "wx19ed4231110485bf" == a.d ? this.jionName = "加盟" : this.jionName = "入驻", 
                    "wx2285aa24a7029f46" != i && "wxcaad2fca5f5aeba1" != i || (this.showother = 1);
                    var n = getCurrentPages();
                    this.showBack = n.length > 1, this.uploadServerUrl = this.$xRequest.url("entry/wxapp/v4uploadimg");
                },
                onShow: function() {
                    var e = this, i = this.$xSign.sign("v4personnel");
                    this.$xRequest.request({
                        url: "entry/wxapp/v4personnel",
                        data: {
                            xgsign: i
                        },
                        success: function(i) {
                            var a = JSON.parse(e.$Decrypt(i.data.data));
                            if (0 == i.data.errno) {
                                if (e.graceFullLoading = !1, e.applStatus = a.info, -1 == a.info) return e.showMsg = !0, 
                                e.msg = i.data.message, setTimeout(function() {
                                    "您的申请已通过!" == i.data.message ? t.redirectTo({
                                        url: "personnel_center"
                                    }) : "请填写详细资料!" == i.data.message ? t.redirectTo({
                                        url: "../editsmjz/editsmjz"
                                    }) : t.reLaunch({
                                        url: "../index/index"
                                    });
                                }, 1200), !1;
                                e.applyCategory = a.category, e.applyCategorys = a.categorys, e.applyCategorysChild = a.childCate, 
                                e.catetype = a.childcate, e.tmplIds = a.tmplIds, e.content = a.content, e.iscard = a.iscard, 
                                e.isalipay = a.isalipay, e.ispic = a.ispic, e.paytype = a.paytype, e.alipay = a.alipay, 
                                e.deposit = a.deposit, e.depositpay = a.depositpay, e.isdeposit = a.isdeposit, e.photoRemark = a.photoremark, 
                                a.nickname || (e.showLogin = !0);
                            }
                        }
                    });
                },
                methods: {
                    decryptPhoneNumber: function(e) {
                        var i = this;
                        if (e.detail.encryptedData && e.detail.iv) {
                            var a = this.$xSign.sign("v4getopenid");
                            this.$xRequest.request({
                                url: "entry/wxapp/v4getopenid",
                                data: {
                                    encryptedData: e.detail.encryptedData,
                                    iv: e.detail.iv,
                                    xgsign: a,
                                    op: "getphone"
                                },
                                success: function(t) {
                                    i.applyTel = t.data.data.purePhoneNumber;
                                },
                                fail: function(e) {
                                    t.showToast({
                                        title: "获取失败，请重试或者手动填写",
                                        icon: "none",
                                        mask: !0
                                    }), i.$xRequest.login();
                                }
                            });
                        } else t.showToast({
                            title: "获取失败，请重试或者手动填写!",
                            icon: "none",
                            mask: !0
                        }), this.$xRequest.login();
                    },
                    closeDialogLogin: function() {
                        this.showLogin = !1;
                    },
                    confirmLogin: function() {
                        var t = this;
                        this.closeDialogLogin();
                        var e = this.$xSign.sign("v4getopenid");
                        wx.getUserProfile({
                            desc: "为您提供更好的服务",
                            success: function(i) {
                                t.$xRequest.request({
                                    url: "entry/wxapp/v4getopenid",
                                    data: {
                                        userinfo: i.userInfo,
                                        xgsign: e,
                                        op: "userprofile"
                                    },
                                    success: function(t) {}
                                });
                            }
                        });
                    },
                    checkedChange: function(t) {
                        this.ischeck = t[0];
                    },
                    showDialog1: function() {
                        this.show1 = !0;
                    },
                    closeDialog1: function() {
                        this.show1 = !1;
                    },
                    bindPickerChange: function(t) {
                        this.cateIndex = t.target.value;
                    },
                    change2: function(t) {
                        this.categorysVal = t;
                    },
                    tapInfo: function(t) {
                        -1 == this.categorysVal.indexOf(t) ? this.categorysVal.push(t) : this.categorysVal.splice(this.categorysVal.indexOf(t), 1);
                    },
                    selectImg1: function() {
                        var e = this;
                        t.chooseImage({
                            count: 1,
                            sizeType: [ "compressed" ],
                            success: function(t) {
                                e.idCard1 = t.tempFilePaths[0];
                            }
                        });
                    },
                    selectImg2: function() {
                        var e = this;
                        t.chooseImage({
                            count: 1,
                            sizeType: [ "compressed" ],
                            success: function(t) {
                                e.idCard2 = t.tempFilePaths[0];
                            }
                        });
                    },
                    imgsChange: function(t) {
                        this.selectedimgs = t;
                    },
                    imgLoaded: function(e) {
                        var i = new Array();
                        if (e.length > 0) {
                            for (var a = 0; a < e.length; a++) i[a] = e[a].url;
                            var n = i.join(",");
                            this.formdata.img = n, 1 == this.showother ? this.$refs.imganduploadLiang.upload() : this.deposit > 0 && 1 == this.isdeposit ? this.toPay(this.formdata) : this.editInfo(this.formdata);
                        } else {
                            if (1 == this.ispic) return this.isWxPay = !1, void t.showModal({
                                title: "提示",
                                content: "请上传必传的照片",
                                showCancel: !1,
                                success: function(t) {}
                            });
                            1 == this.showother ? this.$refs.imganduploadLiang.upload() : this.deposit > 0 && 1 == this.isdeposit ? this.toPay(this.formdata) : this.editInfo(this.formdata);
                        }
                    },
                    imgsChangeLiang: function(t) {
                        this.selectedimgs = t;
                    },
                    imgLoadedLiang: function(e) {
                        var i = new Array();
                        if (e.length > 0) {
                            for (var a = 0; a < e.length; a++) i[a] = e[a].url;
                            var n = i.join(",");
                            this.formdata.uploadimg = n, console.log("提交中"), this.deposit > 0 && 1 == this.isdeposit ? this.toPay(this.formdata) : this.editInfo(this.formdata);
                        } else {
                            if (1 == this.showother) return this.isWxPay = !1, void t.showToast({
                                title: "请上传个人照片",
                                icon: "none"
                            });
                            this.deposit > 0 && 1 == this.isdeposit ? this.toPay(this.formdata) : this.editInfo(this.formdata);
                        }
                    },
                    uploaderror: function() {
                        console.log("上传过程遇到错误");
                    },
                    editInfo: function(e) {
                        var i = this;
                        if (t.showLoading({
                            mask: !0,
                            title: "提交中"
                        }), !(1 != this.iscard || e.card1 && e.card2)) return this.isWxPay = !1, void t.showToast({
                            title: "身份证照片上传错误，请重试",
                            icon: "none"
                        });
                        this.graceFullLoading = !0;
                        var a = this.$xSign.sign("v4personnelset");
                        t.hideLoading(), this.$xRequest.request({
                            url: "entry/wxapp/v4personnelset",
                            data: {
                                xgsign: a,
                                op: "edit",
                                formdata: e
                            },
                            success: function(e) {
                                0 == e.data.errno ? t.showModal({
                                    title: "提示",
                                    content: e.data.message,
                                    showCancel: !1,
                                    complete: function(e) {
                                        e.confirm && (i.tmplIds.length > 0 ? wx.requestSubscribeMessage({
                                            tmplIds: i.tmplIds,
                                            complete: function(e) {
                                                setTimeout(function() {
                                                    t.reLaunch({
                                                        url: "../center/center"
                                                    });
                                                }, 1e3);
                                            }
                                        }) : setTimeout(function() {
                                            t.reLaunch({
                                                url: "../center/center"
                                            });
                                        }, 800));
                                    }
                                }) : (t.hideLoading(), i.isWxPay = !1, i.graceFullLoading = !1, t.showModal({
                                    title: "提示",
                                    content: e.data.message,
                                    showCancel: !1,
                                    complete: function(e) {
                                        i.graceFullLoading = !1, e.confirm && setTimeout(function() {
                                            t.reLaunch({
                                                url: "../center/center"
                                            });
                                        }, 800);
                                    }
                                }));
                            },
                            fail: function(e) {
                                t.hideLoading(), t.showModal({
                                    title: "提示",
                                    content: e.data.message,
                                    showCancel: !1,
                                    complete: function(e) {
                                        i.graceFullLoading = !1, e.confirm && t.reLaunch({
                                            url: "../center/center"
                                        });
                                    }
                                });
                            },
                            complete: function(e) {
                                t.hideLoading();
                            }
                        });
                    },
                    toPay: function(e) {
                        var i = this, a = this.$xSign.sign("v4personnelset");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4personnelset",
                            data: {
                                xgsign: a,
                                op: "topay"
                            },
                            success: function(a) {
                                var n = JSON.parse(i.$Decrypt(a.data.data));
                                a.data && n && !a.data.errno && wx.requestPayment({
                                    timeStamp: n.timeStamp,
                                    nonceStr: n.nonceStr,
                                    package: n.package,
                                    signType: "MD5",
                                    paySign: n.paySign,
                                    success: function(a) {
                                        i.isWxPay = !1, t.showToast({
                                            title: "支付成功",
                                            icon: "none",
                                            duration: 800
                                        }), i.editInfo(e);
                                    },
                                    fail: function(e) {
                                        i.isWxPay = !1, "requestPayment:fail cancel" == e.errMsg && t.showToast({
                                            title: "支付取消",
                                            icon: "none",
                                            duration: 800
                                        });
                                    }
                                });
                            },
                            fail: function(t) {
                                i.isWxPay = !1, wx.showModal({
                                    title: "系统提示",
                                    content: t.data.message ? t.data.message : "错误",
                                    showCancel: !1,
                                    success: function(t) {
                                        t.confirm;
                                    }
                                });
                            }
                        });
                    },
                    confirm: function(e) {
                        var i = this;
                        this.isWxPay = !0;
                        var a = e.detail.value;
                        a.distributorid = this.distributorid, a.category = -1 == this.cateIndex ? -1 : this.applyCategory[this.cateIndex].id;
                        var n = /^[\u0391-\uFFE5]+$/;
                        if (!a.name || !n.test(a.name)) {
                            var o = "请输入正确的" + this.showname;
                            return t.showToast({
                                title: o,
                                icon: "none"
                            }), void (this.isWxPay = !1);
                        }
                        return /(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(a.tel) ? 1 != this.isalipay || a.alipay ? 1 != this.showother || a.othername && n.test(a.othername) ? 1 != this.showother || /(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(a.othermobile) ? (1 != this.isalipay && (a.alipay = this.alipay), 
                        1 != this.iscard || /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(a.cardid) ? 1 != this.iscard || "./static/ps2cd8e5feb924c1f4-b826-4dcd-a986-c338a92b57db.png" != this.idCard1 && "./static/ps8f524a9bcb0ab440-6a40-408d-86a1-64d365a2168a.png" != this.idCard2 ? 0 == this.categorysVal.length ? (t.showToast({
                            title: "请选择" + this.showcate,
                            icon: "none",
                            duration: 800
                        }), void (this.isWxPay = !1)) : 0 == this.ischeck ? (t.showToast({
                            title: "请阅读并同意加盟协议",
                            icon: "none"
                        }), void (this.isWxPay = !1)) : (a.categorys = this.categorysVal.join(","), 1 != this.iscard ? (this.formdata = a, 
                        this.$refs.selectimgandupload.upload(), !1) : (t.showLoading({
                            title: "上传身份证正面"
                        }), void t.uploadFile({
                            url: this.uploadServerUrl,
                            filePath: this.idCard1,
                            name: "img",
                            success: function(e) {
                                "ok" != (e = JSON.parse(e.data)).status ? t.showToast({
                                    title: "上传失败 : " + e.data,
                                    icon: "none"
                                }) : (t.hideLoading(), i.card1 = e.data, a.card1 = e.data, t.showLoading({
                                    title: "上传身份证反面"
                                }), t.uploadFile({
                                    url: i.uploadServerUrl,
                                    filePath: i.idCard2,
                                    name: "img",
                                    success: function(e) {
                                        t.hideLoading(), "ok" != (e = JSON.parse(e.data)).status ? t.showToast({
                                            title: "上传失败 : " + e.data,
                                            icon: "none"
                                        }) : (i.card2 = e.data, a.card2 = e.data, i.formdata = a, i.$refs.selectimgandupload.upload());
                                    },
                                    fail: function(e) {
                                        t.showToast({
                                            title: "上传失败，请重试",
                                            icon: "none"
                                        }), t.hideLoading();
                                    },
                                    complete: function() {
                                        t.hideLoading();
                                    }
                                }));
                            },
                            fail: function(e) {
                                t.showToast({
                                    title: "上传失败，请重试",
                                    icon: "none"
                                }), t.hideLoading();
                            },
                            complete: function() {
                                t.hideLoading();
                            }
                        }))) : (t.showToast({
                            title: "请选择身份证照片",
                            icon: "none"
                        }), void (this.isWxPay = !1)) : (t.showToast({
                            title: "身份证号码不正确",
                            icon: "none"
                        }), void (this.isWxPay = !1))) : (t.showToast({
                            title: "请输入正确的紧急联系人手机号",
                            icon: "none",
                            duration: 800
                        }), void (this.isWxPay = !1)) : (t.showToast({
                            title: "请输入正确的紧急联系人姓名",
                            icon: "none"
                        }), void (this.isWxPay = !1)) : (t.showToast({
                            title: "请填写支付宝账号",
                            icon: "none"
                        }), void (this.isWxPay = !1)) : (t.showToast({
                            title: "请输入正确的手机号码",
                            icon: "none",
                            duration: 800
                        }), void (this.isWxPay = !1));
                    }
                },
                computed: {
                    memberTop: function() {
                        var t = this.CustomBar;
                        return "margin-top:".concat(t, "px;");
                    }
                }
            };
            e.default = n;
        }).call(this, i("543d").default);
    },
    "5c34": function(t, e, i) {
        "use strict";
        i.r(e);
        var a = i("3270"), n = i.n(a);
        for (var o in a) "default" !== o && function(t) {
            i.d(e, t, function() {
                return a[t];
            });
        }(o);
        e.default = n.a;
    },
    "9e89": function(t, e, i) {},
    "9f1f": function(t, e, i) {
        "use strict";
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            i("4e1e"), e(i("66fd")), t(e(i("bdda")).default);
        }).call(this, i("543d").createPage);
    },
    b698: function(t, e, i) {
        "use strict";
        i.d(e, "b", function() {
            return n;
        }), i.d(e, "c", function() {
            return o;
        }), i.d(e, "a", function() {
            return a;
        });
        var a = {
            gracePage: function() {
                return i.e("graceUI/components/gracePage").then(i.bind(null, "1915"));
            },
            graceFullLoading: function() {
                return i.e("graceUI/components/graceFullLoading").then(i.bind(null, "7669"));
            },
            graceDialog: function() {
                return i.e("graceUI/components/graceDialog").then(i.bind(null, "8d15"));
            },
            divider: function() {
                return i.e("components/divider/divider").then(i.bind(null, "bdb7"));
            },
            graceSelectImgAndUpload: function() {
                return Promise.all([ i.e("common/vendor"), i.e("graceUI/components/graceSelectImgAndUpload") ]).then(i.bind(null, "d7ef"));
            },
            graceCheckBtn: function() {
                return i.e("graceUI/components/graceCheckBtn").then(i.bind(null, "d274"));
            },
            graceFixedMsg: function() {
                return i.e("graceUI/components/graceFixedMsg").then(i.bind(null, "d7c7"));
            }
        }, n = function() {
            var t = this, e = (t.$createElement, t._self._c, t.graceFullLoading || 1 != t.applStatus || 2 != t.catetype ? null : t.__map(t.applyCategorysChild, function(e, i) {
                return {
                    $orig: t.__get_orig(e),
                    l0: t.__map(e.child, function(e, i) {
                        return {
                            $orig: t.__get_orig(e),
                            g0: t.categorysVal.indexOf(e.value)
                        };
                    })
                };
            })), i = t.graceFullLoading || 1 != t.applStatus || 2 == t.catetype ? null : t.__map(t.applyCategorys, function(e, i) {
                return {
                    $orig: t.__get_orig(e),
                    g1: t.categorysVal.indexOf(e.value)
                };
            });
            t.$mp.data = Object.assign({}, {
                $root: {
                    l1: e,
                    l2: i
                }
            });
        }, o = [];
    },
    bdda: function(t, e, i) {
        "use strict";
        i.r(e);
        var a = i("b698"), n = i("5c34");
        for (var o in n) "default" !== o && function(t) {
            i.d(e, t, function() {
                return n[t];
            });
        }(o);
        i("cea8");
        var s = i("f0c5"), r = Object(s.a)(n.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        e.default = r.exports;
    },
    cea8: function(t, e, i) {
        "use strict";
        var a = i("9e89");
        i.n(a).a;
    }
}, [ [ "9f1f", "common/runtime", "common/vendor" ] ] ]);